/**
 * 
 * @returns 
 */
function prepareGallery() {
    if(!document.getElementById ||!document.getElementsByName) return false;
    if(!document.getElementById("gallery")) return false;
    let gallery = document.getElementById("gallery");
    let links = gallery.getElementsByTagName("a")
    for(let i=0; i<links.length;i++) {
        links[i].onclick = function() {
            if(showPic(this)) {
                console.log("false")
            }
            console.log(this)
            // console.log(showPic(this))
            return false;
        }
    }
}
/**
 * @param {*} el 
 */
 function showPic(el) {
    let imageNode = document.getElementsByTagName("img");
    let href = el.getAttribute("href");
    // console.log(href);
    let nameNode = document.getElementById("name");
    imageNode[0].setAttribute("src",href)
    // console.log(nameNode)
    nameNode.firstChild.nodeValue = el.firstChild.nodeValue
}
function create() {
    let gallery = document.getElementById("gallery");
    let testdiv = document.createElement('p');
    // console.log(testdiv.nodeType)
    let txt = document.createTextNode("Hello World")
    testdiv.appendChild(txt)
    gallery.appendChild(testdiv);
}
